set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/3rdParty )
find_package(crypto  REQUIRED)
find_package(sqlite3 REQUIRED)

if (${CMAKE_SYSTEM_NAME} STREQUAL Windows)
find_package(pthread REQUIRED)
include_directories( ${pthread_INCLUDE_DIRS} )
endif (${CMAKE_SYSTEM_NAME} STREQUAL Windows)


include_directories( ./include )
include_directories( ${PROJECT_SOURCE_DIR}/PopupLibrary/include )
include_directories( ${PROJECT_SOURCE_DIR}/PopupLibrary/src )
include_directories( ${PROJECT_SOURCE_DIR}/PopupLibOSAL/include )
include_directories( ${crypto_INCLUDE_DIRS} )
include_directories( ${sqlite3_INCLUDE_DIRS} )

file( GLOB sources ./src/*.[hc]pp )

add_library( database-static STATIC ${sources} )
target_link_libraries( database-static osal-static ${crypto_LIBRARY} )
add_dependencies ( database-static 3rdParty )

#add_library( database SHARED ${sources} )
#target_link_libraries( database osal ${crypto_LIBRARY} ${sqlite3_LIBRARY} ${pthread_LIBRARY} )
#add_dependencies ( database 3rdParty )

#install( TARGETS database DESTINATION ${POPUP_INSTALL_DIR}/lib )
